<?php if ($this->_var['full_page']): ?>
<?php echo $this->fetch('pageheader.htm'); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,listtable.js')); ?>
<!-- 订单搜索 -->
<div class="form-div">
  <!-- <form action="javascript:searchOrder()" name="searchForm"> -->
  <form action="distributor.php?act=detailed" name="searchForm" method="post" >
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    用户名<input name="user_name" type="text" id="user_name" size="15">
    手机号<input name="mobile_phone" type="text" id="mobile_phone" size="15">
  <input type="button" value="<?php echo $this->_var['lang']['button_search']; ?>" class="button" onclick="javascript:searchUser();" />
  </form>
</div>

<!-- 订单列表 -->
  <div class="list-div" id="listDiv">
<?php endif; ?>
	<table cellpadding="3" cellspacing="1">
	  <tr>
	    <th>用户ID</th>
	    <th>用户名</th>
	    <th>提现账号</th>
	    <th>绑定手机号</th>
	    <th>成为分销商时间</th>
	    <th>二级分销商数量</th>
	    <th>二级分销商总消费</th>
	    <th>未结算提成</th>
	    <th>待结算提成</th>
	    <th>已结算提成</th>
	    <th>操作</th>
	  </tr>
	<?php $_from = $this->_var['result_user']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'val');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['val']):
?>
	 <tr align="center" >
	    <td><?php echo $this->_var['val']['user_id']; ?></td>
	    <td><?php echo $this->_var['val']['user_name']; ?></td>
	    <td><?php echo $this->_var['val']['withdraw_account']; ?></td>
	    <td><?php echo $this->_var['val']['mobile_phone']; ?></td>
	    <td><?php echo $this->_var['val']['agent1_time']; ?></td>
	    <td><?php echo $this->_var['val']['all_user']; ?></td>
	    <td><?php echo $this->_var['val']['all_price']; ?></td>
	    <td><a href="distributor.php?act=commission_detailed&status=0&user_id=<?php echo $this->_var['val']['user_id']; ?>" ><?php echo $this->_var['val']['price_0']; ?></a></td>
	    <td><a href="distributor.php?act=commission_detailed&status=1&user_id=<?php echo $this->_var['val']['user_id']; ?>" ><?php echo $this->_var['val']['price_1']; ?></a></td>
	    <td><a href="distributor.php?act=commission_detailed&status=2&user_id=<?php echo $this->_var['val']['user_id']; ?>" ><?php echo $this->_var['val']['price_2']; ?></a></td>
	    <td>
	    	<?php if ($this->_var['val']['price_1'] > 0): ?>
	    		<a href="distributor.php?act=do_withdraw&user_id=<?php echo $this->_var['val']['user_id']; ?>">完成提现</a>
	    	<?php else: ?>
	    		-
	    	<?php endif; ?>
	    </td>
  	</tr>
  	<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
	</table>

	<!-- 分页 -->
	<table id="page-table" cellspacing="0">
	  <tr>
	    <td align="right" nowrap="true">
	    <?php echo $this->fetch('page.htm'); ?>
	    </td>
	  </tr>
	</table>
  </div>
<?php if ($this->_var['full_page']): ?>
<script language="JavaScript">
listTable.recordCount = <?php echo $this->_var['filter']['record_count']; ?>;
listTable.pageCount = <?php echo $this->_var['filter']['page_count']; ?>;
listTable.query = "query";
<?php $_from = $this->_var['filter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
listTable.filter.<?php echo $this->_var['key']; ?> = '<?php echo $this->_var['item']; ?>';
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>

    /**
     * 搜索
     */
    function searchUser()
    {
    	listTable.filter['user_name'] = document.forms['searchForm'].elements['user_name'].value;
    	listTable.filter['mobile_phone'] = document.forms['searchForm'].elements['mobile_phone'].value;
        listTable.filter['page'] = 1;
        listTable.loadList();
    }



</script>

<?php echo $this->fetch('pagefooter.htm'); ?>
<?php endif; ?>